#ifndef PSC_CLASSC_MD5_H
#define PSC_CLASSC_MD5_H
#include <cstddef>
#include <cstdint>

class MD5 {
public:
    MD5();
    void update(const unsigned char* input, size_t length);
    void final(unsigned char digest[16]);
    void reset();
private:
    void transform(const unsigned char block[64]);
    void encode(unsigned char* output, const uint32_t* input, size_t len);
    void decode(uint32_t* output, const unsigned char* input, size_t len);
    uint32_t state[4];
    uint32_t count[2];
    unsigned char buffer[64];
    bool finished;
};

#endif // PSC_CLASSC_MD5_H 